<template>
  <div class="hrBox">
    <div class="hrButton">
      <!-- 按钮 -->
      <slot name="btnSlot"></slot>
    </div>
    <el-table
      :data="tableData"
      style="width: 100%;margin-bottom: 20px;"
      :max-height="maxHeight"
      :stripe="stripe"
      border
      :tree-props="{children: 'children'}"
      :row-key="rowKey"
      lazy
      collapse
    >
      <el-table-column
        v-for="item in headerData"
        :key="item.prop"
        :prop="item.prop"
        :label="item.label"
        :width="item.width"
       
      >
      </el-table-column>
      <el-table-column
        prop="operation"
        label="操作"
        width="200"
      >
        <template slot-scope="scope">
          <slot name="operationBtn" v-bind:operationData="scope"></slot>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>

export default {
  mounted(){
  
  },
  methods: {
     
    },
  props: {
    rowKey:{
      type: String,
      default: () => {
        return '';
      },
    },
    headerData: {
      type: Array,
      default: () => {
        return [];
      },
    },
    tableData: {
      type: Array,
      default: () => {
        return [];
      },
    },
    stripe: {
      type: Boolean,
      default: () => {
        return true;
      },
    },
    border: {
      type: Boolean,
      default: () => {
        return false;
      },
    },
    maxHeight: {
      type: Number,
      default: () => {
        return 600;
      },
    },
    // 当前第几页
    currentpage: {
      type: Number,
      default: () => {
        return 1;
      },
    },
    // 一页多少条
    pagesize: {
      type: Number,
      default: () => {
        return 10;
      },
    },
    //总条件
    total: {
      type: Number,
      default: () => {
        return 0;
      },
    },
  },
};
</script>

<style>
.hrButton{
  padding: 20px;
  background-color: white;
  border: 1px solid #efeded;
  border-bottom: none;
}
.el-main{
  background-color: #f6f6f6;
}
div .el-table_1_column_1{
  width: 40%;
}
div .cell{
  text-align: center;
}
</style>